package com.systemmanger.mapper;

import com.bean.WmsTCustomer;
import com.github.pagehelper.PageInfo;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface KeHuGuanLiMapper {
    /** bean类WmsTCustomer
     * 根据客户 ID
     * 客户名称
     * IC卡号
     *修改上次的需求：只查询custIsDel为0的全部wms_t_customer的信息；
     *  * 在客户信息显示页面的每条记录的前方添加一个单选框
     */

    @Select("<script>" +
            "select * from wms_t_customer " +
            "where custIsDel = 0" +
            " <if test=\"custID !=null and custID != ''\" >" +
            "and custID =#{custID}" +
            "</if>" +
            "<if test=\" custName !=null and custName !=''\" >" +
            "and custName =#{custName}" +
            "</if>" +
            "<if test=\"custIc !=null and custIc!='' \" >" +
            "and custIC =#{custIc}" +
            "</if>" +
            "</script>")
    public List<WmsTCustomer> getCustomerMessage(WmsTCustomer wmsTCustomer);
/**
 * 删除该数据
 * update设置custIsDel = 0
 *
 */
    @Update("update wms_t_customer set custIsDel = 1 where custID =#{custID}")
    public void deleteCustomerData(String custID);

/**
 * 更新用户数据
 */
    @Update("update wms_t_customer " +
            "set custName=#{custName},custIc=#{custIc} ,custMobile=#{custMobile}," +
            "custNote=#{custNote},custEditTime=#{custEditTime}" +
            "where custID =#{custID}")
    public  void updateCustomerData(WmsTCustomer wmsTCustomer);
}
